import request from '../request'
import type { Soul } from '@/types/api'

export interface SoulQuery {
  name?: string
  lifeStatus?: boolean
  soulStatus?: number
  page?: number
  pageSize?: number
}

export const getSoulList = (params: SoulQuery) => {
  return request.get<Soul[]>('/souls', { params })
}

export const getSoulById = (id: number) => {
  return request.get<Soul>(`/souls/${id}`)
}

export const createSoul = (data: Omit<Soul, 'id'>) => {
  return request.post<Soul>('/souls', data)
}

export const updateSoul = (id: number, data: Partial<Soul>) => {
  return request.put<Soul>(`/souls/${id}`, data)
}

export const deleteSoul = (id: number) => {
  return request.delete(`/souls/${id}`)
}
